package com.seguriapp.common.gwt.client.pagination;

import com.google.gwt.event.shared.GwtEvent;

public class PageChangedEvent extends GwtEvent<PageChangedEventHandler> {

  public static final Type<PageChangedEventHandler> TYPE = new Type<PageChangedEventHandler>();

  private final long page;

  public PageChangedEvent(final long page) {
    this.page = page;
  }

  @Override
  public GwtEvent.Type<PageChangedEventHandler> getAssociatedType() {
    return TYPE;
  }

  @Override
  protected void dispatch(final PageChangedEventHandler handler) {
    handler.onPageChanged(this);
  }

  public static Type<PageChangedEventHandler> getType() {
    return TYPE;
  }

  public long getPage() {
    return page;
  }

}
